package com.neuedu.web;

import com.neuedu.pojo.AdminTable;
import com.neuedu.pojo.CadreTable;
import com.neuedu.pojo.ClueTable;
import com.neuedu.pojo.Result;
import com.neuedu.service.ClueTableService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/Province")
@Tag(name="省级干部管理线索")
public class ProvinceController {
    @Resource
    private ClueTableService clueTableService;
    //省级干部更新帮扶指导字段
    @GetMapping("/update-helpGuidance")
    public Result<Void> updateHelpGuidance(@RequestParam(name = "clueId")Integer clueId,
                                        @RequestParam(name = "helpGuidance")String helpGuidance) {
        return this.clueTableService.updateHelpGuidance(clueId,helpGuidance);
    }

    //按照省份为干部显示所在省份的线索
    @GetMapping("/getClueTablesByProvince")
    public Result<List<ClueTable>> getClueTablesByProvince(
            @RequestParam(name = "currentPage",defaultValue = "1")Integer currentPage,
            @RequestParam(name = "pageSize",defaultValue = "10")Integer pageSize,
            @RequestParam(name = "province",defaultValue = "")String province) {
        return this.clueTableService.getClueTablesByProvince(currentPage,pageSize,province);
    }
}
